Skip to content

Add a failing test for updating a table with a headerless CSV.#3007

Closed
sinistersnare wants to merge 1 commit into
perspective-dev:masterfrom
sinistersnare:bugfix/csv-header-abort
Closed

Add a failing test for updating a table with a headerless CSV.#3007
sinistersnare wants to merge 1 commit into
perspective-dev:masterfrom
sinistersnare:bugfix/csv-header-abort

Conversation

@sinistersnare

@sinistersnare sinistersnare commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

This PR adds a test that crashes the test suite. It does not provide a fix, so the PR is marked as a draft for now.

Currently Perspective aborts in the C++ by updating a table with a CSV that has no header.

tbl = Table({ "stringcol": "string" })
tbl.update("rowval  \n another row val")

Results in Fatal Python error: Aborted

This bug also occurs in Rust, see the example in the below comment

Signed-off-by: Davis Silverman <davis@thedav.is>
@sinistersnare sinistersnare changed the title Add a failing test awaiting a fix Add a failing test for updating a table with a headerless CSV. Jun 13, 2025
@sinistersnare

Copy link
Copy Markdown
Contributor Author

Here is the Rust example:

use std::error::Error;

use perspective::client::{ColumnType, TableData, UpdateData};
use perspective::server::Server;

#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<(), Box<dyn Error>> {
    let server = Server::default();
    let client = server.new_local_client();
    let schema = TableData::Schema(vec![("stringcol".into(), ColumnType::String)]);
    let table = client.table(schema, Default::default()).await?;
    // Note: No header row!
    let update = UpdateData::Csv("A\nB\n".to_string());
    table.update(update, Default::default()).await?;
    let csv = table.view(None).await?.to_csv(Default::default()).await?;
    println!("CSV:: {csv:?}");
    client.close().await;
    Ok(())
}
$ cargo run
   Compiling example_repo v1.0.0 (/Path/To/Example)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.53s
     Running `target/debug/example_repo`
libc++abi: terminating due to uncaught exception of type std::invalid_argument: stoll: no conversion
[1]    19940 abort      cargo run

@texodus

texodus commented Oct 10, 2025

Copy link
Copy Markdown
Member

This is becoming a bit out-of-scope as CSV parsing is no longer directly handled by Perspective, so I'm going to go ahead and close this. We may revisit the issue in the future as we broaden Perspective's engine support.

@texodus texodus closed this Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants